package model

import (
	"gin-bms/global"
)

type SysMenu struct {
	global.BASE_MODEL
	// MenuLevel uint   `json:"-" grom:"-"`
	ParentId  string `json:"parentId" gorm:"comment:父菜单ID"`
	Path      string `json:"path" gorm:"comment:路由path"`
	Name      string `json:"name" gorm:"comment:路径name"`
	Title     string `json:"title" gorm:"comment:菜单名"`
	Icon      string `json:"icon" gorm:"comment:菜单图标"`
	Component string `json:"component" gorm:"comment:对应前端文件路径"`
	Sort      int    `json:"sort" gorm:"comment:排序标记"`
	Hidden    bool   `json:"hidden" gorm:"comment:是否在列表隐藏"`
	KeepAlive bool   `json:"keepAlive" gorm:"comment:是否缓存"`

	SysRoles   []SysRole          `json:"roles" gorm:"many2many:sys_role_menus"`
	Children   []SysMenu          `json:"children" gorm:"-"`
	Parameters []SysMenuParameter `json:"parameters"`
}

type SysMenuParameter struct {
	global.BASE_MODEL
	SysMenuID uint
	Type      string `json:"type" gorm:"comment:地址携带参数为params还是query"`
	Key       string `json:"key" gorm:"comment:地址栏携带参数的key"`
	Value     string `json:"value" gorm:"comment:地址栏携带参数的值"`
}
